<link rel="stylesheet" href='/addons/comments/assets/css/comments.css'>




<div class="layui-card base-comment-container">
    <div class="layui-card-header">
        <strong>文章评论</strong>
    </div>
    <div class="layui-card-body">
        <ul class="comment-ul">
            {volist name="commentList" id="v"}
            <li class="layui-row layui-col-space15 list">
                <div class="layui-col-md1">
                    <img src="{$v.user.avatar|default='/template/img/avatar.jpg'}" alt="" class="avatar">
                </div>
                <div class="layui-col-md11">
                    <p class="fbtime">
                        {if isset($v.user.nickname)}
                            {$v.user.nickname}
                        {elseif isset($v.user.username)}
                            {$v.user.username}
                        {else /}
                            游客
                        {/if}
                        <span class="create-date">{$v.create_time}</span>
                    </p>
                    <p class="fbinfo">{$v.content}</p>
                </div>
            </li>
            {/volist}
        </ul>
        {if $pageQuery.current_page!=$pageQuery.last_page and $pageQuery.last_page>0}
        <div class="page">
            <button type="button"  class="layui-btn layui-btn-normal load-comments" data-topic_type="{$param['topic_type']}" data-arc_id="{$param['topic_id']}" data-url="{:addons_url('comments://post/commnents_page')}" data-per_page="{$pageQuery.per_page|default=15}" data-current_page="{$pageQuery.current_page|default=1}" data-last_page="{$pageQuery.last_page|default=1}"  data-total="{$pageQuery.total|default=0}">加载更多</button>
        </div>
        {/if}
    </div>
    <div class="layui-card-body">
        <p class="saying">
            来说两句吧...
            <span>
                <a href="">共有{$pageQuery.total|default=0}条评论</a>
            </span>
        </p>
        <form action='{:addons_url("comments://post/add")}' class="layui-form" method="post">
            <div class="layui-form-item">
                <textarea name="content" id="" cols="30" rows="10" class="layui-textarea"></textarea>
            </div>
            <div class="layui-form-item">
                <input type="hidden" value="{$param.topic_type}" name="topic_type">
                <input type="hidden" value="{$param.topic_id}" name="topic_id">
                <input type="hidden" value="{$param.from_uid}" name="from_uid">
                <input type="hidden" value="{$param.to_uid}" name="to_uid">
                <button class="layui-btn" lay-submit lay-filter="comment">提交</button>
            </div>
        </form>
    </div>
</div>




<script type="text/javascript" src="{:assets_url('comments/js/comments.js')}"></script>